package pulpfizz.physics.contact;

import org.jbox2d.collision.Shape;
import org.jbox2d.dynamics.DestructionListener;
import org.jbox2d.dynamics.joints.Joint;

import pulpfizz.physics.NewWorld;

/**
 * This is called when a joint in the world is implicitly destroyed
 *	because an attached body is destroyed. This gives us a chance to
 *	nullify the mouse joint.
 */
public class ConcreteDestructionListener implements DestructionListener {
	private NewWorld newWorld;

	public ConcreteDestructionListener(NewWorld physicsHandler) {
		this.newWorld = physicsHandler;
	}
	public void sayGoodbye(Shape shape) {; }
	public void sayGoodbye(Joint joint) {
		this.newWorld.jointDestroyed(joint);
	}
	
}